﻿<?xml version="1.0" encoding="utf-8"?><Articles><Article><ArticlesID>610</ArticlesID><Title>C&amp;#225;ch enabled c&amp;#225;c control bằng JavaScript</Title><Body>&amp;lt;p&amp;gt;C&amp;amp;aacute;c bạn c&amp;amp;oacute; thể d&amp;amp;ugrave;ng qua thuộc t&amp;amp;iacute;nh disabled của mỗi Element trong HTML c&amp;amp;aacute;i n&amp;amp;agrave;y c&amp;amp;oacute; gi&amp;amp;aacute; trị l&amp;amp;agrave; True/False.&amp;lt;/p&amp;gt;
&amp;lt;pre class=&amp;quot;brush: jscript;&amp;quot; title=&amp;quot;code&amp;quot;&amp;gt;
       var MySite = {
           Validate: function() {
               var cb1 = document.getElementById(&amp;amp;quot;cb1&amp;amp;quot;);
               var btn1 = document.getElementById(&amp;amp;quot;btn1&amp;amp;quot;);
               if (cb1.checked) {
                   btn1.disabled = true;
               } else {
                   btn1.disabled = false;
               }
           }
       }&amp;lt;/pre&amp;gt;
&amp;lt;pre class=&amp;quot;brush: xhtml;&amp;quot; title=&amp;quot;code&amp;quot;&amp;gt;
&amp;amp;lt;input type=&amp;amp;quot;checkbox&amp;amp;quot; name=&amp;amp;quot;cb1&amp;amp;quot; id=&amp;amp;quot;cb1&amp;amp;quot; value=&amp;amp;quot;1&amp;amp;quot; onclick=&amp;amp;quot;javascript:MySite.Validate();&amp;amp;quot; /&amp;amp;gt;
   &amp;amp;lt;input type=&amp;amp;quot;button&amp;amp;quot; name=&amp;amp;quot;btn1&amp;amp;quot; id=&amp;amp;quot;btn1&amp;amp;quot; value=&amp;amp;quot;Submit&amp;amp;quot; /&amp;amp;gt;&amp;lt;/pre&amp;gt;
&amp;lt;p style=&amp;quot;text-align: right;&amp;quot;&amp;gt;Theo justin@aspvn.net&amp;lt;/p&amp;gt;</Body><CommentEnabled>True</CommentEnabled><ViewCount>0</ViewCount><ReleaseDate>11/12/2009 8:53:37 AM</ReleaseDate><TotalComment>0</TotalComment><IsMedia>False</IsMedia><IsPicture>False</IsPicture><IsVote>True</IsVote><ArticlePassword /><PostVisible>0</PostVisible><ArticlePath>/2009/11/12/Cach-enabled-cac-control-bang-JavaScript-262</ArticlePath><Approved>True</Approved><ImagePath /><CategoryId>30</CategoryId><ArrayCatID>30|25</ArrayCatID></Article></Articles>